.class public Lcom/facebook/orca/images/ImageSearchActivity;
.super Lcom/facebook/orca/activity/OrcaFragmentActivity;
.source "ImageSearchActivity.java"


# instance fields
.field private A:I

.field private B:Landroid/os/Bundle;

.field private C:Ljava/lang/String;

.field private D:I

.field private E:I

.field private a:Lcom/facebook/orca/images/ImageSearchListAdapter;
    .annotation runtime Lcom/google/inject/Inject;
    .end annotation
.end field

.field private n:Landroid/view/inputmethod/InputMethodManager;
    .annotation runtime Lcom/google/inject/Inject;
    .end annotation
.end field

.field private o:Lcom/facebook/orca/images/ImageCache;
    .annotation runtime Lcom/google/inject/Inject;
    .end annotation
.end field

.field private p:Lcom/facebook/orca/common/ui/titlebar/TitleBar;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f08002e
    .end annotation
.end field

.field private q:Landroid/widget/EditText;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f08006e
    .end annotation
.end field

.field private r:Landroid/widget/Button;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f08006f
    .end annotation
.end field

.field private s:Landroid/widget/GridView;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080070
    .end annotation
.end field

.field private t:Landroid/widget/RelativeLayout;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080072
    .end annotation
.end field

.field private u:Landroid/widget/TextView;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080073
    .end annotation
.end field

.field private v:Landroid/widget/TextView;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080074
    .end annotation
.end field

.field private w:Landroid/widget/TextView;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080075
    .end annotation
.end field

.field private x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;
    .annotation runtime Lroboguice/inject/InjectView;
        a = 0x7f080071
    .end annotation
.end field

.field private y:Lcom/facebook/orca/ops/OrcaServiceFragment;

.field private z:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, -0x1

    .line 35
    invoke-direct {p0}, Lcom/facebook/orca/activity/OrcaFragmentActivity;-><init>()V

    .line 65
    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    .line 69
    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    return-void
.end method

.method static synthetic a(Lcom/facebook/orca/images/ImageSearchActivity;)Landroid/widget/EditText;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->q:Landroid/widget/EditText;

    return-object v0
.end method

.method static synthetic a(Lcom/facebook/orca/images/ImageSearchActivity;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 35
    invoke-direct {p0, p1}, Lcom/facebook/orca/images/ImageSearchActivity;->b(I)V

    return-void
.end method

.method static synthetic a(Lcom/facebook/orca/images/ImageSearchActivity;Landroid/os/Bundle;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 35
    invoke-direct {p0, p1}, Lcom/facebook/orca/images/ImageSearchActivity;->c(Landroid/os/Bundle;)V

    return-void
.end method

.method static synthetic a(Lcom/facebook/orca/images/ImageSearchActivity;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 35
    invoke-direct {p0, p1}, Lcom/facebook/orca/images/ImageSearchActivity;->a(Z)V

    return-void
.end method

.method private a(Ljava/lang/String;I)V
    .locals 4
    .parameter
    .parameter

    .prologue
    const/16 v3, 0x8

    .line 189
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    invoke-virtual {v0}, Lcom/facebook/orca/ops/OrcaServiceFragment;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 212
    :goto_0
    return-void

    .line 194
    :cond_0
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 195
    const-string v1, "AppId"

    const-string v2, "E71A777BBC850CF326C995ECDA7AFA3577A5749F"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 196
    const-string v1, "Query"

    invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 197
    const-string v1, "Sources"

    const-string v2, "Image"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 198
    const-string v1, "Version"

    const-string v2, "2.0"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 199
    const-string v1, "Market"

    const-string v2, "en-us"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 200
    const-string v1, "Adult"

    const-string v2, "Strict"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 201
    const-string v1, "Image.Count"

    const-string v2, "8"

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 202
    const-string v1, "Image.Offset"

    mul-int/lit8 v2, p2, 0x8

    invoke-static {v2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 203
    iput p2, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    .line 204
    iput-object p1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    .line 205
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    const-string v2, "image_search"

    invoke-virtual {v1, v2, v0}, Lcom/facebook/orca/ops/OrcaServiceFragment;->a(Ljava/lang/String;Landroid/os/Bundle;)V

    .line 207
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    invoke-virtual {v0, v3}, Landroid/widget/GridView;->setVisibility(I)V

    .line 208
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->t:Landroid/widget/RelativeLayout;

    invoke-virtual {v0, v3}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 209
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setVisibility(I)V

    .line 210
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->a(Z)V

    .line 211
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    const v1, 0x7f0a00f8

    invoke-virtual {p0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setMessage(Ljava/lang/CharSequence;)V

    goto :goto_0
.end method

.method private a(Z)V
    .locals 3
    .parameter

    .prologue
    const/4 v2, 0x1

    .line 178
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    if-nez v0, :cond_1

    .line 186
    :cond_0
    :goto_0
    return-void

    .line 181
    :cond_1
    if-eqz p1, :cond_2

    iget v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    if-lez v0, :cond_2

    .line 182
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    sub-int/2addr v1, v2

    invoke-direct {p0, v0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->a(Ljava/lang/String;I)V

    goto :goto_0

    .line 183
    :cond_2
    if-nez p1, :cond_0

    iget v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    sub-int/2addr v1, v2

    if-ge v0, v1, :cond_0

    .line 184
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    add-int/lit8 v1, v1, 0x1

    invoke-direct {p0, v0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->a(Ljava/lang/String;I)V

    goto :goto_0
.end method

.method static synthetic b(Lcom/facebook/orca/images/ImageSearchActivity;)Landroid/view/inputmethod/InputMethodManager;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->n:Landroid/view/inputmethod/InputMethodManager;

    return-object v0
.end method

.method private b()V
    .locals 2

    .prologue
    .line 166
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->q:Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    .line 167
    invoke-static {v0}, Lcom/facebook/orca/common/util/StringUtil;->a(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 175
    :cond_0
    :goto_0
    return-void

    .line 170
    :cond_1
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    invoke-virtual {v1}, Lcom/facebook/orca/ops/OrcaServiceFragment;->b()Z

    move-result v1

    if-nez v1, :cond_0

    .line 174
    const/4 v1, 0x0

    invoke-direct {p0, v0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->a(Ljava/lang/String;I)V

    goto :goto_0
.end method

.method private b(I)V
    .locals 3
    .parameter

    .prologue
    .line 270
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->a:Lcom/facebook/orca/images/ImageSearchListAdapter;

    invoke-virtual {v0, p1}, Lcom/facebook/orca/images/ImageSearchListAdapter;->a(I)Landroid/os/Bundle;

    move-result-object v0

    .line 271
    const-string v1, "Thumbnail"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/os/Bundle;

    .line 272
    const-string v1, "Url"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 273
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->o:Lcom/facebook/orca/images/ImageCache;

    new-instance v2, Lcom/facebook/orca/images/ImageCacheKey;

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-direct {v2, v0}, Lcom/facebook/orca/images/ImageCacheKey;-><init>(Landroid/net/Uri;)V

    invoke-virtual {v1, v2}, Lcom/facebook/orca/images/ImageCache;->a(Lcom/facebook/orca/images/ImageCacheKey;)Landroid/net/Uri;

    move-result-object v0

    .line 274
    if-eqz v0, :cond_0

    .line 275
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    .line 276
    invoke-virtual {v1, v0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 277
    const/4 v0, -0x1

    invoke-virtual {p0, v0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->setResult(ILandroid/content/Intent;)V

    .line 278
    invoke-virtual {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->finish()V

    .line 280
    :cond_0
    return-void
.end method

.method private c()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    const/4 v1, -0x1

    const/4 v0, 0x0

    .line 232
    iput v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    .line 233
    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    .line 234
    iput v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    .line 235
    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    .line 236
    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->B:Landroid/os/Bundle;

    .line 237
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    invoke-virtual {v0, v2}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->a(Z)V

    .line 238
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    const v1, 0x7f0a00f9

    invoke-virtual {p0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setMessage(Ljava/lang/CharSequence;)V

    .line 239
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    invoke-virtual {v0, v2}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setVisibility(I)V

    .line 240
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/GridView;->setVisibility(I)V

    .line 241
    return-void
.end method

.method private c(Landroid/os/Bundle;)V
    .locals 3
    .parameter

    .prologue
    .line 215
    invoke-direct {p0, p1}, Lcom/facebook/orca/images/ImageSearchActivity;->d(Landroid/os/Bundle;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 216
    invoke-direct {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->c()V

    .line 229
    :goto_0
    return-void

    .line 219
    :cond_0
    const-string v0, "SearchResponse"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/os/Bundle;

    .line 220
    const-string v1, "Image"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v1

    check-cast v1, Landroid/os/Bundle;

    .line 221
    const-string v2, "Total"

    invoke-virtual {v1, v2}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v1

    .line 222
    div-int/lit8 v1, v1, 0x8

    const/16 v2, 0x8

    invoke-static {v1, v2}, Ljava/lang/Math;->min(II)I

    move-result v1

    iput v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    .line 223
    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    iput v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    .line 224
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    iput-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    .line 225
    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->B:Landroid/os/Bundle;

    .line 226
    const/4 v0, -0x1

    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    .line 227
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    .line 228
    invoke-direct {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->d()V

    goto :goto_0
.end method

.method static synthetic c(Lcom/facebook/orca/images/ImageSearchActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 35
    invoke-direct {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->b()V

    return-void
.end method

.method private d()V
    .locals 7

    .prologue
    const/4 v6, 0x4

    const/4 v3, 0x2

    const/4 v5, 0x1

    const/16 v2, 0x8

    const/4 v4, 0x0

    .line 244
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    invoke-virtual {v0, v4}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->a(Z)V

    .line 246
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->B:Landroid/os/Bundle;

    const-string v1, "Image"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/os/Bundle;

    .line 247
    const-string v1, "Results"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getParcelableArrayList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v0

    .line 249
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-nez v1, :cond_0

    .line 250
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    invoke-virtual {v0, v4}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setVisibility(I)V

    .line 251
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    const v1, 0x7f0a00fa

    invoke-virtual {p0, v1}, Lcom/facebook/orca/images/ImageSearchActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setMessage(Ljava/lang/CharSequence;)V

    .line 252
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->t:Landroid/widget/RelativeLayout;

    invoke-virtual {v0, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 253
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    invoke-virtual {v0, v2}, Landroid/widget/GridView;->setVisibility(I)V

    .line 267
    :goto_0
    return-void

    .line 255
    :cond_0
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    invoke-virtual {v1, v4}, Landroid/widget/GridView;->setVisibility(I)V

    .line 256
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->x:Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;

    invoke-virtual {v1, v2}, Lcom/facebook/orca/common/ui/widgets/EmptyListViewItem;->setVisibility(I)V

    .line 257
    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->a:Lcom/facebook/orca/images/ImageSearchListAdapter;

    invoke-virtual {v1, v0}, Lcom/facebook/orca/images/ImageSearchListAdapter;->a(Ljava/util/List;)V

    .line 258
    iget v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    const/4 v1, -0x1

    if-eq v0, v1, :cond_1

    iget v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    if-ge v0, v3, :cond_2

    .line 259
    :cond_1
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->t:Landroid/widget/RelativeLayout;

    invoke-virtual {v0, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    goto :goto_0

    .line 261
    :cond_2
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->t:Landroid/widget/RelativeLayout;

    invoke-virtual {v0, v4}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 262
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->u:Landroid/widget/TextView;

    const v1, 0x7f0a00f5

    new-array v2, v3, [Ljava/lang/Object;

    iget v3, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    add-int/lit8 v3, v3, 0x1

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    iget v3, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-virtual {p0, v1, v2}, Lcom/facebook/orca/images/ImageSearchActivity;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 263
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->v:Landroid/widget/TextView;

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    if-lez v1, :cond_3

    move v1, v4

    :goto_1
    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

    .line 264
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->w:Landroid/widget/TextView;

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    iget v2, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    sub-int/2addr v2, v5

    if-ge v1, v2, :cond_4

    move v1, v4

    :goto_2
    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_0

    :cond_3
    move v1, v6

    .line 263
    goto :goto_1

    :cond_4
    move v1, v6

    .line 264
    goto :goto_2
.end method

.method static synthetic d(Lcom/facebook/orca/images/ImageSearchActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 35
    invoke-direct {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->c()V

    return-void
.end method

.method private d(Landroid/os/Bundle;)Z
    .locals 2
    .parameter

    .prologue
    const/4 v1, 0x0

    .line 283
    const-string v0, "SearchResponse"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object p0

    check-cast p0, Landroid/os/Bundle;

    .line 284
    if-nez p0, :cond_0

    move v0, v1

    .line 296
    :goto_0
    return v0

    .line 287
    :cond_0
    const-string v0, "Image"

    invoke-virtual {p0, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object p0

    check-cast p0, Landroid/os/Bundle;

    .line 288
    if-nez p0, :cond_1

    move v0, v1

    .line 289
    goto :goto_0

    .line 292
    :cond_1
    const-string v0, "Results"

    invoke-virtual {p0, v0}, Landroid/os/Bundle;->getParcelableArrayList(Ljava/lang/String;)Ljava/util/ArrayList;

    move-result-object v0

    .line 293
    if-nez v0, :cond_2

    move v0, v1

    .line 294
    goto :goto_0

    .line 296
    :cond_2
    const/4 v0, 0x1

    goto :goto_0
.end method


# virtual methods
.method protected a(Landroid/os/Bundle;)V
    .locals 1
    .parameter

    .prologue
    .line 74
    invoke-super {p0, p1}, Lcom/facebook/orca/activity/OrcaFragmentActivity;->a(Landroid/os/Bundle;)V

    .line 75
    const v0, 0x7f030018

    invoke-virtual {p0, v0}, Lcom/facebook/orca/images/ImageSearchActivity;->setContentView(I)V

    .line 76
    return-void
.end method

.method public b(Landroid/os/Bundle;)V
    .locals 4
    .parameter

    .prologue
    const/4 v3, 0x1

    .line 79
    invoke-super {p0, p1}, Lcom/facebook/orca/activity/OrcaFragmentActivity;->b(Landroid/os/Bundle;)V

    .line 81
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->r:Landroid/widget/Button;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$1;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$1;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 89
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->q:Landroid/widget/EditText;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$2;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$2;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setOnEditorActionListener(Landroid/widget/TextView$OnEditorActionListener;)V

    .line 102
    const-string v0, "imageSearchOperation"

    invoke-virtual {p0, v0}, Lcom/facebook/orca/images/ImageSearchActivity;->a(Ljava/lang/String;)Lcom/facebook/orca/ops/OrcaServiceFragment;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    .line 103
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$3;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$3;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Lcom/facebook/orca/ops/OrcaServiceFragment;->a(Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;)V

    .line 114
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->y:Lcom/facebook/orca/ops/OrcaServiceFragment;

    new-instance v1, Lcom/facebook/orca/ops/TitlebarProgressProgressIndicator;

    iget-object v2, p0, Lcom/facebook/orca/images/ImageSearchActivity;->p:Lcom/facebook/orca/common/ui/titlebar/TitleBar;

    invoke-direct {v1, v2}, Lcom/facebook/orca/ops/TitlebarProgressProgressIndicator;-><init>(Lcom/facebook/orca/common/ui/titlebar/TitleBar;)V

    invoke-virtual {v0, v1}, Lcom/facebook/orca/ops/OrcaServiceFragment;->a(Lcom/facebook/orca/ops/OperationProgressIndicator;)V

    .line 116
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->v:Landroid/widget/TextView;

    invoke-virtual {v0, v3}, Landroid/widget/TextView;->setClickable(Z)V

    .line 117
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->v:Landroid/widget/TextView;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$4;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$4;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 123
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->w:Landroid/widget/TextView;

    invoke-virtual {v0, v3}, Landroid/widget/TextView;->setClickable(Z)V

    .line 124
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->w:Landroid/widget/TextView;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$5;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$5;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 131
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->a:Lcom/facebook/orca/images/ImageSearchListAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/GridView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 132
    iget-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->s:Landroid/widget/GridView;

    new-instance v1, Lcom/facebook/orca/images/ImageSearchActivity$6;

    invoke-direct {v1, p0}, Lcom/facebook/orca/images/ImageSearchActivity$6;-><init>(Lcom/facebook/orca/images/ImageSearchActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/GridView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 138
    return-void
.end method

.method protected onRestoreInstanceState(Landroid/os/Bundle;)V
    .locals 1
    .parameter

    .prologue
    .line 153
    invoke-super {p0, p1}, Lcom/facebook/orca/activity/OrcaFragmentActivity;->onRestoreInstanceState(Landroid/os/Bundle;)V

    .line 154
    const-string v0, "currentQuery"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    .line 155
    const-string v0, "currentPage"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    .line 156
    const-string v0, "currentResponse"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getBundle(Ljava/lang/String;)Landroid/os/Bundle;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->B:Landroid/os/Bundle;

    .line 157
    const-string v0, "loadingQuery"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    .line 158
    const-string v0, "loadingPage"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    .line 159
    const-string v0, "numPages"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    .line 160
    iget v0, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    if-ltz v0, :cond_0

    .line 161
    invoke-direct {p0}, Lcom/facebook/orca/images/ImageSearchActivity;->d()V

    .line 163
    :cond_0
    return-void
.end method

.method protected onSaveInstanceState(Landroid/os/Bundle;)V
    .locals 2
    .parameter

    .prologue
    .line 142
    invoke-super {p0, p1}, Lcom/facebook/orca/activity/OrcaFragmentActivity;->onSaveInstanceState(Landroid/os/Bundle;)V

    .line 143
    const-string v0, "currentQuery"

    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->z:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 144
    const-string v0, "currentPage"

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->A:I

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 145
    const-string v0, "currentResponse"

    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->B:Landroid/os/Bundle;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putBundle(Ljava/lang/String;Landroid/os/Bundle;)V

    .line 146
    const-string v0, "loadingQuery"

    iget-object v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->C:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 147
    const-string v0, "loadingPage"

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->D:I

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 148
    const-string v0, "numPages"

    iget v1, p0, Lcom/facebook/orca/images/ImageSearchActivity;->E:I

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V

    .line 149
    return-void
.end method
